package com.levy.contronller.jvm.classLoader;

/**
 * Created by levy on 2019/5/20.
 */
public class MyTest7 {

    static {
        System.out.println("Mytest7 static block");
    }

    public static void main(String[] args) {
        Parent2 parent2;
        System.out.println("----------");
        System.out.println(Child2.b);
        System.out.println("----------");
        parent2 = new Parent2();
        System.out.println("----------");
        System.out.println(Parent2.a);

    }

}

class Parent2 {

    static int a = 3;

    static {
        System.out.println("parent2 static block");
    }
}

class Child2 extends Parent2 {

    static int b = 4;

    static {
        System.out.println("child2 static block");
    }

}

